#ifndef IIRFILTER_H
#define IIRFILTER_H
#include "stdint.h"

typedef float float32_t;

#define StageNum 4
#define SAMPLES 1000

/*
SOS Matrix:
1  2  1  1  -1.9718980553462933  0.9757968390803613
1  2  1  1  -1.9287692228718867  0.93258273343979659
1  2  1  1  -1.897013405250819   0.90076412907127623
1  2  1  1  -1.8802595219238372  0.88397712041734355

Scale Values:
0.00097469593351704614
0.00095337764197749714
0.0009376809551143783
0.00092939962337658714
*/



typedef struct
{
    uint32_t numStages;      /**< number of 2nd order stages in the filter.  Overall order is 2*numStages. */
    float32_t *pState;       /**< Points to the array of state coefficients.  The array is of length 4*numStages. */
    float32_t *pCoeffs;      /**< Points to the array of coefficients.  The array is of length 5*numStages. */
} arm_biquad_casd_df1_inst_f32;

void arm_biquad_cascade_df1_init_f32(
                                     arm_biquad_casd_df1_inst_f32 * S,
                                     uint8_t numStages,
                                     float32_t * pCoeffs,
                                     float32_t * pState);

float32_t arm_biquad_cascade_df1_f32(
                                const arm_biquad_casd_df1_inst_f32 * S,
                                float32_t pSrc);

#endif // IIRFILTER_H
